// @ts-ignore
/* eslint-disable */
// @ts-ignore
import { request } from 'umi';


/** 注册新用户 POST /api/user/register */
export async function registerUser(registerParam : API.RegisterParams,options?: { [key: string]: any }){

  return request<number>('/api/user/register', {
    data: registerParam,
    method: 'POST',
    ...(options || {}),
  });
}

/** 用户登录 POST /api/user/login */
export async function loginUser(loginParams : API.LoginParams,options?: { [key: string]: any }){

  return request<boolean>('/api/user/login', {
    data: loginParams,
    method: 'POST',
    ...(options || {}),
  });
}

/** 获取当前的用户 GET /api/currentUser */
export async function currentUser(options?: { [key: string]: any }) {
  return request<API.CurrentUser>('/api/user/currentUser', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 用户退出登录 POST /api/user/logout */
export async function logoutUser(options?: { [key: string]: any }){

  return request<number>('/api/user/logout', {
    method: 'get',
    ...(options || {}),
  });
}

/** 获取所有用户信息 GET /api/user/getAllUser */
export async function getAllUser(options?: { [key: string]: any }){

  return request<API.CurrentUser>('/api/user/getAllUser', {
    method: 'get',
    ...(options || {}),
  });
}

/** 更新用户信息 POST /api/user/updateUser */
export async function updateUser(updateUser: API.CurrentUser,options?: { [key: string]: any }){

  return request<boolean>('/api/user/updateUser', {
    data: updateUser,
    method: 'POST',
    ...(options || {}),
  });

}


/** 删除用户信息(测试GET参数封装) GET /api/user/deleteUser */
export async function deleteUser__(id: number,options?: { [key: string]: any }){
  return request<boolean>(`/api/user/deleteUser`, {
    method: 'GET',
    params: {id: id},
    ...(options || {}),
  });
}



/** 删除用户信息 GET /api/user/deleteUser */
export async function deleteUser(id: number,options?: { [key: string]: any }){
  return request<boolean>(`/api/user/deleteUser/${id}`, {
    method: 'GET',
    ...(options || {}),
  });
}


